package org.lib.rabbitmqhello.try2;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

@Component
@Slf4j
public class Try2Listener {

	/**
	 * Listener1
	 * @author ben
	 * @date 2021-08-23 22:31:58 CST
	 * @param content
	 */
	@RabbitListener(queues = {RabbitConfig2.QUEUE_21})
	public void processMessage1(String content) {
		log.info("接收消息：队列{}-processMessage1-content={}", 
				RabbitConfig2.QUEUE_21, content);
	}
	
	/**
	 * Listener2
	 * @author ben
	 * @date 2021-08-27 21:26:30 CST
	 * @param content
	 */
	@RabbitListener(queues = {RabbitConfig2.QUEUE_21})
	public void processMessage2(String content) {
		log.info("接收消息：队列{}-processMessage2-content={}",
				RabbitConfig2.QUEUE_21, content);
	}
	
	/**
	 * Listener3
	 * @author ben
	 * @date 2021-08-27 21:26:30 CST
	 * @param content
	 */
	@RabbitListener(queues = {RabbitConfig2.QUEUE_22})
	public void processMessage3(String content) {
		log.info("接收消息：队列{}-processMessage3-content={}", RabbitConfig2.QUEUE_22, content);
	}
	
}
